

package com.hazelcast.client.impl.protocol;

import com.hazelcast.client.impl.protocol.codec.*;
import com.hazelcast.client.impl.protocol.task.*;
import com.hazelcast.client.impl.protocol.task.cache.*;
import com.hazelcast.client.impl.protocol.task.cardinality.CardinalityEstimatorAddMessageTask;
import com.hazelcast.client.impl.protocol.task.cardinality.CardinalityEstimatorEstimateMessageTask;
import com.hazelcast.client.impl.protocol.task.crdt.pncounter.PNCounterAddMessageTask;
import com.hazelcast.client.impl.protocol.task.crdt.pncounter.PNCounterGetConfiguredReplicaCountMessageTask;
import com.hazelcast.client.impl.protocol.task.crdt.pncounter.PNCounterGetMessageTask;
import com.hazelcast.client.impl.protocol.task.dynamicconfig.*;
import com.hazelcast.client.impl.protocol.task.executorservice.*;
import com.hazelcast.client.impl.protocol.task.executorservice.durable.*;
import com.hazelcast.client.impl.protocol.task.list.*;
import com.hazelcast.client.impl.protocol.task.management.*;
import com.hazelcast.client.impl.protocol.task.map.*;
import com.hazelcast.client.impl.protocol.task.metrics.ReadMetricsMessageTask;
import com.hazelcast.client.impl.protocol.task.multimap.*;
import com.hazelcast.client.impl.protocol.task.queue.*;
import com.hazelcast.client.impl.protocol.task.replicatedmap.*;
import com.hazelcast.client.impl.protocol.task.ringbuffer.*;
import com.hazelcast.client.impl.protocol.task.scheduledexecutor.*;
import com.hazelcast.client.impl.protocol.task.schema.FetchSchemaMessageTask;
import com.hazelcast.client.impl.protocol.task.schema.SendAllSchemasMessageTask;
import com.hazelcast.client.impl.protocol.task.schema.SendSchemaMessageTask;
import com.hazelcast.client.impl.protocol.task.set.*;
import com.hazelcast.client.impl.protocol.task.topic.TopicAddMessageListenerMessageTask;
import com.hazelcast.client.impl.protocol.task.topic.TopicPublishAllMessageTask;
import com.hazelcast.client.impl.protocol.task.topic.TopicPublishMessageTask;
import com.hazelcast.client.impl.protocol.task.topic.TopicRemoveMessageListenerMessageTask;
import com.hazelcast.client.impl.protocol.task.transaction.*;
import com.hazelcast.client.impl.protocol.task.transactionallist.TransactionalListAddMessageTask;
import com.hazelcast.client.impl.protocol.task.transactionallist.TransactionalListRemoveMessageTask;
import com.hazelcast.client.impl.protocol.task.transactionallist.TransactionalListSizeMessageTask;
import com.hazelcast.client.impl.protocol.task.transactionalmap.*;
import com.hazelcast.client.impl.protocol.task.transactionalmultimap.*;
import com.hazelcast.client.impl.protocol.task.transactionalqueue.*;
import com.hazelcast.client.impl.protocol.task.transactionalset.TransactionalSetAddMessageTask;
import com.hazelcast.client.impl.protocol.task.transactionalset.TransactionalSetRemoveMessageTask;
import com.hazelcast.client.impl.protocol.task.transactionalset.TransactionalSetSizeMessageTask;
import com.hazelcast.flakeidgen.impl.client.NewIdBatchMessageTask;
import com.hazelcast.instance.impl.Node;
import com.hazelcast.internal.longregister.client.codec.*;
import com.hazelcast.internal.longregister.client.task.*;
import com.hazelcast.internal.util.collection.Int2ObjectHashMap;
import com.hazelcast.spi.impl.NodeEngine;
import com.hazelcast.sql.impl.client.SqlCloseMessageTask;
import com.hazelcast.sql.impl.client.SqlExecuteMessageTask;
import com.hazelcast.sql.impl.client.SqlFetchMessageTask;
import com.hazelcast.sql.impl.client.SqlMappingDdlTask;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import static com.hazelcast.internal.util.MapUtil.createInt2ObjectHashMap;

@SuppressWarnings({"ClassDataAbstractionCoupling", "ClassFanOutComplexity"})
public class DefaultMessageTaskFactoryProvider implements MessageTaskFactoryProvider {
    private static final int MESSAGE_TASK_PROVIDER_INITIAL_CAPACITY = 500;

    private final Int2ObjectHashMap<MessageTaskFactory> factories;

    private final Node node;

    public DefaultMessageTaskFactoryProvider(NodeEngine nodeEngine) {
        this.node = nodeEngine.getNode();
        this.factories = createInt2ObjectHashMap(MESSAGE_TASK_PROVIDER_INITIAL_CAPACITY);
        initFactories();
    }

    public void initFactories() {
        initializeSetTaskFactories();
        initializeRingBufferTaskFactories();
        initializeCacheTaskFactories();
        initializeReplicatedMapTaskFactories();
        initializeLongRegisterClientTaskFactories();
        initializeTransactionalListTaskFactories();
        initializeTransactionalMultiMapTaskFactories();
        initializeListTaskFactories();
        initializeTransactionalQueueTaskFactories();
        initializeMultiMapTaskFactories();
        initializeTopicTaskFactories();
        initializeTransactionalMapTaskFactories();
        initializeExecutorServiceTaskFactories();
        initializeDurableExecutorTaskFactories();
        initializeTransactionTaskFactories();
        initializeTransactionalSetTaskFactories();
        initializeMapTaskFactories();
        initializeGeneralTaskFactories();
        initializeQueueTaskFactories();
        initializeCardinalityTaskFactories();
        initializeScheduledExecutorTaskFactories();
        initializeContinuousMapQueryOperations();
        initializeDynamicConfigTaskFactories();
        initializeFlakeIdGeneratorTaskFactories();
        initializePnCounterTaskFactories();
        initializeManagementCenterTaskFactories();
        initializeSqlTaskFactories();
        initializeSchemaFactories();
    }

    private void initializeSetTaskFactories() {
        factories.put(SetRemoveListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetRemoveListenerMessageTask(cm, node, con));
        factories.put(SetClearCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetClearMessageTask(cm, node, con));
        factories.put(SetCompareAndRemoveAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetCompareAndRemoveAllMessageTask(cm, node, con));
        factories.put(SetContainsAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetContainsAllMessageTask(cm, node, con));
        factories.put(SetIsEmptyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetIsEmptyMessageTask(cm, node, con));
        factories.put(SetAddAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetAddAllMessageTask(cm, node, con));
        factories.put(SetAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetAddMessageTask(cm, node, con));
        factories.put(SetCompareAndRetainAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetCompareAndRetainAllMessageTask(cm, node, con));
        factories.put(SetGetAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetGetAllMessageTask(cm, node, con));
        factories.put(SetRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetRemoveMessageTask(cm, node, con));
        factories.put(SetAddListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetAddListenerMessageTask(cm, node, con));
        factories.put(SetContainsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetContainsMessageTask(cm, node, con));
        factories.put(SetSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetSizeMessageTask(cm, node, con));
    }

    private void initializeRingBufferTaskFactories() {
        factories.put(RingbufferReadOneCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferReadOneMessageTask(cm, node, con));
        factories.put(RingbufferAddAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferAddAllMessageTask(cm, node, con));
        factories.put(RingbufferCapacityCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferCapacityMessageTask(cm, node, con));
        factories.put(RingbufferTailSequenceCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferTailSequenceMessageTask(cm, node, con));
        factories.put(RingbufferAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferAddMessageTask(cm, node, con));
        factories.put(RingbufferRemainingCapacityCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferRemainingCapacityMessageTask(cm, node, con));
        factories.put(RingbufferReadManyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferReadManyMessageTask(cm, node, con));
        factories.put(RingbufferHeadSequenceCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferHeadSequenceMessageTask(cm, node, con));
        factories.put(RingbufferSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RingbufferSizeMessageTask(cm, node, con));
    }

    @SuppressWarnings("MethodLength")
    private void initializeCacheTaskFactories() {
        factories.put(CacheClearCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheClearMessageTask(cm, node, con));
        factories.put(CacheFetchNearCacheInvalidationMetadataCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheFetchNearCacheInvalidationMetadataTask(cm, node, con));
        factories.put(CacheReplaceCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheReplaceMessageTask(cm, node, con));
        factories.put(CacheContainsKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheContainsKeyMessageTask(cm, node, con));
        factories.put(CacheCreateConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheCreateConfigMessageTask(cm, node, con));
        factories.put(CacheGetAndReplaceCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheGetAndReplaceMessageTask(cm, node, con));
        factories.put(CacheGetAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheGetAllMessageTask(cm, node, con));
        factories.put(CachePutCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CachePutMessageTask(cm, node, con));
        factories.put(CacheAddNearCacheInvalidationListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheAddNearCacheInvalidationListenerTask(cm, node, con));
        factories.put(CachePutAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CachePutAllMessageTask(cm, node, con));
        factories.put(CacheSetExpiryPolicyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheSetExpiryPolicyMessageTask(cm, node, con));
        factories.put(CacheLoadAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheLoadAllMessageTask(cm, node, con));
        factories.put(CacheListenerRegistrationCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheListenerRegistrationMessageTask(cm, node, con));
        factories.put(CacheAddEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheAddEntryListenerMessageTask(cm, node, con));
        factories.put(CacheRemoveEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheRemoveEntryListenerMessageTask(cm, node, con));
        factories.put(CacheRemoveInvalidationListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheRemoveInvalidationListenerMessageTask(cm, node, con));
        factories.put(CacheDestroyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheDestroyMessageTask(cm, node, con));
        factories.put(CacheRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheRemoveMessageTask(cm, node, con));
        factories.put(CacheEntryProcessorCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheEntryProcessorMessageTask(cm, node, con));
        factories.put(CacheGetAndRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheGetAndRemoveMessageTask(cm, node, con));
        factories.put(CacheManagementConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheManagementConfigMessageTask(cm, node, con));
        factories.put(CachePutIfAbsentCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CachePutIfAbsentMessageTask(cm, node, con));
        factories.put(CacheRemoveAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheRemoveAllMessageTask(cm, node, con));
        factories.put(CacheRemoveAllKeysCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheRemoveAllKeysMessageTask(cm, node, con));
        factories.put(CacheIterateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheIterateMessageTask(cm, node, con));
        factories.put(CacheAddPartitionLostListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheAddPartitionLostListenerMessageTask(cm, node, con));
        factories.put(CacheGetConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheGetConfigMessageTask(cm, node, con));
        factories.put(CacheGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheGetMessageTask(cm, node, con));
        factories.put(CacheRemovePartitionLostListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheRemovePartitionLostListenerMessageTask(cm, node, con));
        factories.put(CacheSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheSizeMessageTask(cm, node, con));
        factories.put(CacheIterateEntriesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheIterateEntriesMessageTask(cm, node, con));
        factories.put(CacheEventJournalSubscribeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheEventJournalSubscribeTask(cm, node, con));
        factories.put(CacheEventJournalReadCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CacheEventJournalReadTask<>(cm, node, con));
    }

    private void initializeReplicatedMapTaskFactories() {
        factories.put(ReplicatedMapSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapSizeMessageTask(cm, node, con));
        factories.put(ReplicatedMapRemoveEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapRemoveEntryListenerMessageTask(cm, node, con));
        factories.put(ReplicatedMapAddEntryListenerToKeyWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapAddEntryListenerToKeyWithPredicateMessageTask(cm, node, con));
        factories.put(ReplicatedMapIsEmptyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapIsEmptyMessageTask(cm, node, con));
        factories.put(ReplicatedMapPutAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapPutAllMessageTask(cm, node, con));
        factories.put(ReplicatedMapContainsKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapContainsKeyMessageTask(cm, node, con));
        factories.put(ReplicatedMapContainsValueCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapContainsValueMessageTask(cm, node, con));
        factories.put(ReplicatedMapAddNearCacheEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapAddNearCacheListenerMessageTask(cm, node, con));
        factories.put(ReplicatedMapGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapGetMessageTask(cm, node, con));
        factories.put(ReplicatedMapAddEntryListenerWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapAddEntryListenerWithPredicateMessageTask(cm, node, con));
        factories.put(ReplicatedMapAddEntryListenerToKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapAddEntryListenerToKeyMessageTask(cm, node, con));
        factories.put(ReplicatedMapRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapRemoveMessageTask(cm, node, con));
        factories.put(ReplicatedMapClearCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapClearMessageTask(cm, node, con));
        factories.put(ReplicatedMapValuesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapValuesMessageTask(cm, node, con));
        factories.put(ReplicatedMapEntrySetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapEntrySetMessageTask(cm, node, con));
        factories.put(ReplicatedMapPutCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapPutMessageTask(cm, node, con));
        factories.put(ReplicatedMapAddEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapAddEntryListenerMessageTask(cm, node, con));
        factories.put(ReplicatedMapKeySetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapKeySetMessageTask(cm, node, con));
        factories.put(ReplicatedMapPutAllWithMetadataCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapPutAllWithMetadataMessageTask(cm, node, con));
        factories.put(ReplicatedMapFetchEntryViewsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapFetchEntryViewsMessageTask(cm, node, con));
        factories.put(ReplicatedMapEndEntryViewIterationCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReplicatedMapEndEntryViewIterationMessageTask(cm, node, con));
    }

    private void initializeLongRegisterClientTaskFactories() {
        factories.put(LongRegisterDecrementAndGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new LongRegisterDecrementAndGetMessageTask(cm, node, con));
        factories.put(LongRegisterGetAndAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new LongRegisterGetAndAddMessageTask(cm, node, con));
        factories.put(LongRegisterAddAndGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new LongRegisterAddAndGetMessageTask(cm, node, con));
        factories.put(LongRegisterGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new LongRegisterGetMessageTask(cm, node, con));
        factories.put(LongRegisterSetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new LongRegisterSetMessageTask(cm, node, con));
        factories.put(LongRegisterIncrementAndGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new LongRegisterIncrementAndGetMessageTask(cm, node, con));
        factories.put(LongRegisterGetAndSetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new LongRegisterGetAndSetMessageTask(cm, node, con));
        factories.put(LongRegisterGetAndIncrementCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new LongRegisterGetAndIncrementMessageTask(cm, node, con));
    }

    private void initializeTransactionalListTaskFactories() {
        factories.put(TransactionalListSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalListSizeMessageTask(cm, node, con));
        factories.put(TransactionalListRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalListRemoveMessageTask(cm, node, con));
        factories.put(TransactionalListAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalListAddMessageTask(cm, node, con));
    }

    private void initializeTransactionalMultiMapTaskFactories() {
        factories.put(TransactionalMultiMapPutCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMultiMapPutMessageTask(cm, node, con));
        factories.put(TransactionalMultiMapRemoveEntryCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMultiMapRemoveEntryMessageTask(cm, node, con));
        factories.put(TransactionalMultiMapGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMultiMapGetMessageTask(cm, node, con));
        factories.put(TransactionalMultiMapRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMultiMapRemoveMessageTask(cm, node, con));
        factories.put(TransactionalMultiMapSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMultiMapSizeMessageTask(cm, node, con));
        factories.put(TransactionalMultiMapValueCountCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMultiMapValueCountMessageTask(cm, node, con));
    }

    private void initializeListTaskFactories() {
        factories.put(ListGetAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListGetAllMessageTask(cm, node, con));
        factories.put(ListListIteratorCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListListIteratorMessageTask(cm, node, con));
        factories.put(ListSetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListSetMessageTask(cm, node, con));
        factories.put(ListAddAllWithIndexCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListAddAllWithIndexMessageTask(cm, node, con));
        factories.put(ListCompareAndRemoveAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListCompareAndRemoveAllMessageTask(cm, node, con));
        factories.put(ListGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListGetMessageTask(cm, node, con));
        factories.put(ListRemoveListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListRemoveListenerMessageTask(cm, node, con));
        factories.put(ListRemoveWithIndexCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListRemoveWithIndexMessageTask(cm, node, con));
        factories.put(ListAddListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListAddListenerMessageTask(cm, node, con));
        factories.put(ListIteratorCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListIteratorMessageTask(cm, node, con));
        factories.put(ListClearCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListClearMessageTask(cm, node, con));
        factories.put(ListAddAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListAddAllMessageTask(cm, node, con));
        factories.put(ListAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListAddMessageTask(cm, node, con));
        factories.put(ListAddWithIndexCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListAddWithIndexMessageTask(cm, node, con));
        factories.put(ListLastIndexOfCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListLastIndexOfMessageTask(cm, node, con));
        factories.put(ListRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListRemoveMessageTask(cm, node, con));
        factories.put(ListSubCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListSubMessageTask(cm, node, con));
        factories.put(ListContainsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListContainsMessageTask(cm, node, con));
        factories.put(ListIndexOfCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListIndexOfMessageTask(cm, node, con));
        factories.put(ListSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListSizeMessageTask(cm, node, con));
        factories.put(ListContainsAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListContainsAllMessageTask(cm, node, con));
        factories.put(ListIsEmptyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListIsEmptyMessageTask(cm, node, con));
        factories.put(ListCompareAndRetainAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ListCompareAndRetainAllMessageTask(cm, node, con));
    }

    private void initializeTransactionalQueueTaskFactories() {
        factories.put(TransactionalQueueSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalQueueSizeMessageTask(cm, node, con));
        factories.put(TransactionalQueueOfferCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalQueueOfferMessageTask(cm, node, con));
        factories.put(TransactionalQueuePeekCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalQueuePeekMessageTask(cm, node, con));
        factories.put(TransactionalQueuePollCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalQueuePollMessageTask(cm, node, con));
        factories.put(TransactionalQueueTakeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalQueueTakeMessageTask(cm, node, con));
    }

    private void initializeMultiMapTaskFactories() {
        factories.put(MultiMapClearCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapClearMessageTask(cm, node, con));
        factories.put(MultiMapGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapGetMessageTask(cm, node, con));
        factories.put(MultiMapRemoveEntryCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapRemoveEntryMessageTask(cm, node, con));
        factories.put(MultiMapContainsKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapContainsKeyMessageTask(cm, node, con));
        factories.put(MultiMapSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapSizeMessageTask(cm, node, con));
        factories.put(MultiMapAddEntryListenerToKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapAddEntryListenerToKeyMessageTask(cm, node, con));
        factories.put(MultiMapAddEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapAddEntryListenerMessageTask(cm, node, con));
        factories.put(MultiMapRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapRemoveMessageTask(cm, node, con));
        factories.put(MultiMapTryLockCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapTryLockMessageTask(cm, node, con));
        factories.put(MultiMapIsLockedCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapIsLockedMessageTask(cm, node, con));
        factories.put(MultiMapContainsValueCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapContainsValueMessageTask(cm, node, con));
        factories.put(MultiMapKeySetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapKeySetMessageTask(cm, node, con));
        factories.put(MultiMapPutCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapPutMessageTask(cm, node, con));
        factories.put(MultiMapPutAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapPutAllMessageTask(cm, node, con));
        factories.put(MultiMapEntrySetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapEntrySetMessageTask(cm, node, con));
        factories.put(MultiMapValueCountCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapValueCountMessageTask(cm, node, con));
        factories.put(MultiMapUnlockCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapUnlockMessageTask(cm, node, con));
        factories.put(MultiMapLockCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapLockMessageTask(cm, node, con));
        factories.put(MultiMapRemoveEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapRemoveEntryListenerMessageTask(cm, node, con));
        factories.put(MultiMapContainsEntryCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapContainsEntryMessageTask(cm, node, con));
        factories.put(MultiMapForceUnlockCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapForceUnlockMessageTask(cm, node, con));
        factories.put(MultiMapValuesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapValuesMessageTask(cm, node, con));
        factories.put(MultiMapDeleteCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MultiMapDeleteMessageTask(cm, node, con));
    }

    private void initializeTopicTaskFactories() {
        factories.put(TopicPublishCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TopicPublishMessageTask(cm, node, con));
        factories.put(TopicPublishAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TopicPublishAllMessageTask(cm, node, con));
        factories.put(TopicAddMessageListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TopicAddMessageListenerMessageTask(cm, node, con));
        factories.put(TopicRemoveMessageListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TopicRemoveMessageListenerMessageTask(cm, node, con));
    }

    private void initializeTransactionalMapTaskFactories() {
        factories.put(TransactionalMapValuesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapValuesMessageTask(cm, node, con));
        factories.put(TransactionalMapSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapSizeMessageTask(cm, node, con));
        factories.put(TransactionalMapPutIfAbsentCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapPutIfAbsentMessageTask(cm, node, con));
        factories.put(TransactionalMapRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapRemoveMessageTask(cm, node, con));
        factories.put(TransactionalMapGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapGetMessageTask(cm, node, con));
        factories.put(TransactionalMapGetForUpdateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapGetForUpdateMessageTask(cm, node, con));
        factories.put(TransactionalMapIsEmptyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapIsEmptyMessageTask(cm, node, con));
        factories.put(TransactionalMapKeySetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapKeySetMessageTask(cm, node, con));
        factories.put(TransactionalMapKeySetWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapKeySetWithPredicateMessageTask(cm, node, con));
        factories.put(TransactionalMapReplaceIfSameCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapReplaceIfSameMessageTask(cm, node, con));
        factories.put(TransactionalMapContainsKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapContainsKeyMessageTask(cm, node, con));
        factories.put(TransactionalMapRemoveIfSameCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapRemoveIfSameMessageTask(cm, node, con));
        factories.put(TransactionalMapSetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapSetMessageTask(cm, node, con));
        factories.put(TransactionalMapReplaceCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapReplaceMessageTask(cm, node, con));
        factories.put(TransactionalMapPutCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapPutMessageTask(cm, node, con));
        factories.put(TransactionalMapDeleteCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapDeleteMessageTask(cm, node, con));
        factories.put(TransactionalMapValuesWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalMapValuesWithPredicateMessageTask(cm, node, con));
    }

    private void initializeExecutorServiceTaskFactories() {
        factories.put(ExecutorServiceCancelOnPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ExecutorServiceCancelOnPartitionMessageTask(cm, node, con));
        factories.put(ExecutorServiceSubmitToPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ExecutorServiceSubmitToPartitionMessageTask(cm, node, con));
        factories.put(ExecutorServiceCancelOnMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ExecutorServiceCancelOnAddressMessageTask(cm, node, con));
        factories.put(ExecutorServiceIsShutdownCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ExecutorServiceIsShutdownMessageTask(cm, node, con));
        factories.put(ExecutorServiceShutdownCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ExecutorServiceShutdownMessageTask(cm, node, con));
        factories.put(ExecutorServiceSubmitToMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ExecutorServiceSubmitToAddressMessageTask(cm, node, con));
    }

    private void initializeDurableExecutorTaskFactories() {
        factories.put(DurableExecutorSubmitToPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DurableExecutorSubmitToPartitionMessageTask(cm, node, con));
        factories.put(DurableExecutorIsShutdownCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DurableExecutorIsShutdownMessageTask(cm, node, con));
        factories.put(DurableExecutorShutdownCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DurableExecutorShutdownMessageTask(cm, node, con));
        factories.put(DurableExecutorRetrieveResultCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DurableExecutorRetrieveResultMessageTask(cm, node, con));
        factories.put(DurableExecutorDisposeResultCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DurableExecutorDisposeResultMessageTask(cm, node, con));
        factories.put(DurableExecutorRetrieveAndDisposeResultCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DurableExecutorRetrieveAndDisposeResultMessageTask(cm, node, con));
    }

    private void initializeTransactionTaskFactories() {
        factories.put(TransactionCreateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionCreateMessageTask(cm, node, con));
        factories.put(XATransactionClearRemoteCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new XAClearRemoteTransactionMessageTask(cm, node, con));
        factories.put(XATransactionFinalizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new XAFinalizeTransactionMessageTask(cm, node, con));
        factories.put(TransactionCommitCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionCommitMessageTask(cm, node, con));
        factories.put(XATransactionCollectTransactionsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new XACollectTransactionsMessageTask(cm, node, con));
        factories.put(XATransactionPrepareCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new XATransactionPrepareMessageTask(cm, node, con));
        factories.put(XATransactionCreateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new XATransactionCreateMessageTask(cm, node, con));
        factories.put(TransactionRollbackCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionRollbackMessageTask(cm, node, con));
        factories.put(XATransactionCommitCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new XATransactionCommitMessageTask(cm, node, con));
        factories.put(XATransactionRollbackCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new XATransactionRollbackMessageTask(cm, node, con));
    }

    private void initializeTransactionalSetTaskFactories() {
        factories.put(TransactionalSetSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalSetSizeMessageTask(cm, node, con));
        factories.put(TransactionalSetAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalSetAddMessageTask(cm, node, con));
        factories.put(TransactionalSetRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TransactionalSetRemoveMessageTask(cm, node, con));
    }

    @SuppressWarnings("MethodLength")
    private void initializeMapTaskFactories() {
        factories.put(MapEntriesWithPagingPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapEntriesWithPagingPredicateMessageTask(cm, node, con));
        factories.put(MapAddEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddEntryListenerMessageTask(cm, node, con));
        factories.put(MapFetchNearCacheInvalidationMetadataCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapFetchNearCacheInvalidationMetadataTask(cm, node, con));
        factories.put(MapRemoveIfSameCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapRemoveIfSameMessageTask(cm, node, con));
        factories.put(MapAddInterceptorCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddInterceptorMessageTask(cm, node, con));
        factories.put(MapEntriesWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapEntriesWithPredicateMessageTask(cm, node, con));
        factories.put(MapPutTransientCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPutTransientMessageTask(cm, node, con));
        factories.put(MapContainsValueCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapContainsValueMessageTask(cm, node, con));
        factories.put(MapIsEmptyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapIsEmptyMessageTask(cm, node, con));
        factories.put(MapReplaceCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapReplaceMessageTask(cm, node, con));
        factories.put(MapRemoveInterceptorCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapRemoveInterceptorMessageTask(cm, node, con));
        factories.put(MapAddNearCacheInvalidationListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddNearCacheInvalidationListenerMessageTask(cm, node, con));
        factories.put(MapExecuteOnAllKeysCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapExecuteOnAllKeysMessageTask(cm, node, con));
        factories.put(MapFlushCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapFlushMessageTask(cm, node, con));
        factories.put(MapSetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapSetMessageTask(cm, node, con));
        factories.put(MapTryLockCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapTryLockMessageTask(cm, node, con));
        factories.put(MapAddEntryListenerToKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddEntryListenerToKeyMessageTask(cm, node, con));
        factories.put(MapEntrySetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapEntrySetMessageTask(cm, node, con));
        factories.put(MapClearCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapClearMessageTask(cm, node, con));
        factories.put(MapLockCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapLockMessageTask(cm, node, con));
        factories.put(MapGetEntryViewCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapGetEntryViewMessageTask(cm, node, con));
        factories.put(MapRemovePartitionLostListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapRemovePartitionLostListenerMessageTask(cm, node, con));
        factories.put(MapLoadGivenKeysCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapLoadGivenKeysMessageTask(cm, node, con));
        factories.put(MapExecuteWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapExecuteWithPredicateMessageTask(cm, node, con));
        factories.put(MapRemoveAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapRemoveAllMessageTask(cm, node, con));
        factories.put(MapPutIfAbsentCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPutIfAbsentMessageTask(cm, node, con));
        factories.put(MapTryRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapTryRemoveMessageTask(cm, node, con));
        factories.put(MapPutCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPutMessageTask(cm, node, con));
        factories.put(MapUnlockCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapUnlockMessageTask(cm, node, con));
        factories.put(MapSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapSizeMessageTask(cm, node, con));
        factories.put(MapValuesWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapValuesWithPredicateMessageTask(cm, node, con));
        factories.put(MapAddEntryListenerToKeyWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddEntryListenerToKeyWithPredicateMessageTask(cm, node, con));
        factories.put(MapEvictCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapEvictMessageTask(cm, node, con));
        factories.put(MapGetAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapGetAllMessageTask(cm, node, con));
        factories.put(MapReplaceAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapReplaceAllMessageTask(cm, node, con));
        factories.put(MapForceUnlockCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapForceUnlockMessageTask(cm, node, con));
        factories.put(MapLoadAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapLoadAllMessageTask(cm, node, con));
        factories.put(MapAddIndexCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddIndexMessageTask(cm, node, con));
        factories.put(MapExecuteOnKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapExecuteOnKeyMessageTask(cm, node, con));
        factories.put(MapKeySetWithPagingPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapKeySetWithPagingPredicateMessageTask(cm, node, con));
        factories.put(MapRemoveEntryListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapRemoveEntryListenerMessageTask(cm, node, con));
        factories.put(MapIsLockedCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapIsLockedMessageTask(cm, node, con));
        factories.put(MapEvictAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapEvictAllMessageTask(cm, node, con));
        factories.put(MapSubmitToKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapSubmitToKeyMessageTask(cm, node, con));
        factories.put(MapValuesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapValuesMessageTask(cm, node, con));
        factories.put(MapAddEntryListenerWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddEntryListenerWithPredicateMessageTask(cm, node, con));
        factories.put(MapDeleteCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapDeleteMessageTask(cm, node, con));
        factories.put(MapAddPartitionLostListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddPartitionLostListenerMessageTask(cm, node, con));
        factories.put(MapPutAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPutAllMessageTask(cm, node, con));
        factories.put(MapRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapRemoveMessageTask(cm, node, con));
        factories.put(MapKeySetWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapKeySetWithPredicateMessageTask(cm, node, con));
        factories.put(MapExecuteOnKeysCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapExecuteOnKeysMessageTask(cm, node, con));
        factories.put(MapReplaceIfSameCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapReplaceIfSameMessageTask(cm, node, con));
        factories.put(MapContainsKeyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapContainsKeyMessageTask(cm, node, con));
        factories.put(MapTryPutCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapTryPutMessageTask(cm, node, con));
        factories.put(MapValuesWithPagingPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapValuesWithPagingPredicateMessageTask(cm, node, con));
        factories.put(MapGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapGetMessageTask(cm, node, con));
        factories.put(MapKeySetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapKeySetMessageTask(cm, node, con));
        factories.put(MapFetchKeysCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapFetchKeysMessageTask(cm, node, con));
        factories.put(MapFetchEntriesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapFetchEntriesMessageTask(cm, node, con));
        factories.put(MapAggregateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAggregateMessageTask(cm, node, con));
        factories.put(MapAggregateWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAggregateWithPredicateMessageTask(cm, node, con));
        factories.put(MapProjectCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapProjectionMessageTask(cm, node, con));
        factories.put(MapProjectWithPredicateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapProjectionWithPredicateMessageTask(cm, node, con));
        factories.put(MapFetchWithQueryCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapFetchWithQueryMessageTask(cm, node, con));
        factories.put(MapEventJournalSubscribeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapEventJournalSubscribeTask(cm, node, con));
        factories.put(MapEventJournalReadCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapEventJournalReadTask<>(cm, node, con));
        factories.put(MapSetTtlCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapSetTtlMessageTask(cm, node, con));
        factories.put(MapSetWithMaxIdleCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapSetWithMaxIdleMessageTask(cm, node, con));
        factories.put(MapPutWithMaxIdleCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPutWithMaxIdleMessageTask(cm, node, con));
        factories.put(MapPutIfAbsentWithMaxIdleCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPutIfAbsentWithMaxIdleMessageTask(cm, node, con));
        factories.put(MapPutTransientWithMaxIdleCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPutTransientWithMaxIdleMessageTask(cm, node, con));
        factories.put(MapPutAllWithMetadataCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPutAllWithMetadataMessageTask(cm, node, con));
    }

    private void initializeGeneralTaskFactories() {
        factories.put(ClientAddPartitionLostListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddPartitionLostListenerMessageTask(cm, node, con));
        factories.put(ClientRemovePartitionLostListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RemovePartitionLostListenerMessageTask(cm, node, con));
        factories.put(ClientAddMigrationListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddMigrationListenerMessageTask(cm, node, con));
        factories.put(ClientRemoveMigrationListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RemoveMigrationListenerMessageTask(cm, node, con));
        factories.put(ClientCreateProxyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CreateProxyMessageTask(cm, node, con));
        factories.put(ClientGetDistributedObjectsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new GetDistributedObjectsMessageTask(cm, node, con));
        factories.put(ClientAddDistributedObjectListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddDistributedObjectListenerMessageTask(cm, node, con));
        factories.put(ClientDestroyProxyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DestroyProxyMessageTask(cm, node, con));
        factories.put(ClientPingCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new PingMessageTask(cm, node, con));
        factories.put(ClientAddClusterViewListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddClusterViewListenerMessageTask(cm, node, con));
        factories.put(ClientAuthenticationCustomCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AuthenticationCustomCredentialsMessageTask(cm, node, con));
        factories.put(ClientRemoveDistributedObjectListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RemoveDistributedObjectListenerMessageTask(cm, node, con));
        factories.put(ClientAuthenticationCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AuthenticationMessageTask(cm, node, con));
        factories.put(ClientStatisticsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ClientStatisticsMessageTask(cm, node, con));
        factories.put(ClientDeployClassesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DeployClassesMessageTask(cm, node, con));
        factories.put(ClientCreateProxiesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CreateProxiesMessageTask(cm, node, con));
        factories.put(ClientLocalBackupListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddBackupListenerMessageTask(cm, node, con));
        factories.put(ClientTriggerPartitionAssignmentCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new TriggerPartitionAssignmentMessageTask(cm, node, con));
        factories.put(ClientTpcAuthenticationCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ClientTpcAuthenticationMessageTask(cm, node, con));
    }

    private void initializeQueueTaskFactories() {
        factories.put(QueueCompareAndRemoveAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueCompareAndRemoveAllMessageTask(cm, node, con));
        factories.put(QueueContainsAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueContainsAllMessageTask(cm, node, con));
        factories.put(QueueAddAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueAddAllMessageTask(cm, node, con));
        factories.put(QueueTakeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueTakeMessageTask(cm, node, con));
        factories.put(QueueAddListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueAddListenerMessageTask(cm, node, con));
        factories.put(QueueCompareAndRetainAllCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueCompareAndRetainAllMessageTask(cm, node, con));
        factories.put(QueueOfferCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueOfferMessageTask(cm, node, con));
        factories.put(QueuePeekCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueuePeekMessageTask(cm, node, con));
        factories.put(QueueRemoveCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueRemoveMessageTask(cm, node, con));
        factories.put(QueueIsEmptyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueIsEmptyMessageTask(cm, node, con));
        factories.put(QueueIteratorCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueIteratorMessageTask(cm, node, con));
        factories.put(QueueSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueSizeMessageTask(cm, node, con));
        factories.put(QueuePutCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueuePutMessageTask(cm, node, con));
        factories.put(QueueContainsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueContainsMessageTask(cm, node, con));
        factories.put(QueuePollCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueuePollMessageTask(cm, node, con));
        factories.put(QueueDrainToCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueDrainMessageTask(cm, node, con));
        factories.put(QueueRemoveListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueRemoveListenerMessageTask(cm, node, con));
        factories.put(QueueRemainingCapacityCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueRemainingCapacityMessageTask(cm, node, con));
        factories.put(QueueClearCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueClearMessageTask(cm, node, con));
        factories.put(QueueDrainToMaxSizeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueDrainMaxSizeMessageTask(cm, node, con));
    }

    private void initializeCardinalityTaskFactories() {
        factories.put(CardinalityEstimatorAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CardinalityEstimatorAddMessageTask(cm, node, con));
        factories.put(CardinalityEstimatorEstimateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CardinalityEstimatorEstimateMessageTask(cm, node, con));
    }

    private void initializeScheduledExecutorTaskFactories() {
        factories.put(ScheduledExecutorSubmitToPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorSubmitToPartitionMessageTask(cm, node, con));
        factories.put(ScheduledExecutorSubmitToMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorSubmitToTargetMessageTask(cm, node, con));
        factories.put(ScheduledExecutorShutdownCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorShutdownMessageTask(cm, node, con));
        factories.put(ScheduledExecutorDisposeFromPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskDisposeFromPartitionMessageTask(cm, node, con));
        factories.put(ScheduledExecutorDisposeFromMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskDisposeFromTargetMessageTask(cm, node, con));
        factories.put(ScheduledExecutorCancelFromPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskCancelFromPartitionMessageTask(cm, node, con));
        factories.put(ScheduledExecutorCancelFromMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskCancelFromTargetMessageTask(cm, node, con));
        factories.put(ScheduledExecutorIsDoneFromPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskIsDoneFromPartitionMessageTask(cm, node, con));
        factories.put(ScheduledExecutorIsDoneFromMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskIsDoneFromTargetMessageTask(cm, node, con));
        factories.put(ScheduledExecutorGetDelayFromPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskGetDelayFromPartitionMessageTask(cm, node, con));
        factories.put(ScheduledExecutorGetDelayFromMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskGetDelayFromTargetMessageTask(cm, node, con));
        factories.put(ScheduledExecutorGetStatsFromPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskGetStatisticsFromPartitionMessageTask(cm, node, con));
        factories.put(ScheduledExecutorGetStatsFromMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskGetStatisticsFromTargetMessageTask(cm, node, con));
        factories.put(ScheduledExecutorGetResultFromPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskGetResultFromPartitionMessageTask(cm, node, con));
        factories.put(ScheduledExecutorGetResultFromMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskGetResultFromTargetMessageTask(cm, node, con));
        factories.put(ScheduledExecutorGetAllScheduledFuturesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorGetAllScheduledMessageTask(cm, node, con));
        factories.put(ScheduledExecutorIsCancelledFromPartitionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskIsCancelledFromPartitionMessageTask(cm, node, con));
        factories.put(ScheduledExecutorIsCancelledFromMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ScheduledExecutorTaskIsCancelledFromTargetMessageTask(cm, node, con));
    }

    private void initializeContinuousMapQueryOperations() {
        factories.put(ContinuousQueryDestroyCacheCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapDestroyCacheMessageTask(cm, node, con));
        factories.put(ContinuousQueryPublisherCreateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPublisherCreateMessageTask(cm, node, con));
        factories.put(ContinuousQuerySetReadCursorCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapSetReadCursorMessageTask(cm, node, con));
        factories.put(ContinuousQueryAddListenerCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapAddListenerMessageTask(cm, node, con));
        factories.put(ContinuousQueryMadePublishableCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapMadePublishableMessageTask(cm, node, con));
        factories.put(ContinuousQueryPublisherCreateWithValueCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MapPublisherCreateWithValueMessageTask(cm, node, con));
    }

    private void initializeDynamicConfigTaskFactories() {
        factories.put(DynamicConfigAddMultiMapConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddMultiMapConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddCardinalityEstimatorConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddCardinalityEstimatorConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddExecutorConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddExecutorConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddDurableExecutorConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddDurableExecutorConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddScheduledExecutorConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddScheduledExecutorConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddRingbufferConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddRingbufferConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddListConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddListConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddSetConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddSetConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddTopicConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddTopicConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddReplicatedMapConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddReplicatedMapConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddQueueConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddQueueConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddMapConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddMapConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddReliableTopicConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddReliableTopicConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddCacheConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddCacheConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddFlakeIdGeneratorConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddFlakeIdGeneratorConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddPNCounterConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddPNCounterConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddDataConnectionConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddDataConnectionConfigMessageTask(cm, node, con));
        factories.put(DynamicConfigAddWanReplicationConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddWanReplicationConfigTask(cm, node, con));
        factories.put(DynamicConfigAddUserCodeNamespaceConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddUserCodeNamespaceConfigMessageTask(cm, node, con));
        factories.put(MCSetDiagnosticsConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SetDiagnosticsConfigMessageTask(cm, node, con));
    }

    private void initializeFlakeIdGeneratorTaskFactories() {
        factories.put(FlakeIdGeneratorNewIdBatchCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new NewIdBatchMessageTask(cm, node, con));
    }

    private void initializePnCounterTaskFactories() {
        factories.put(PNCounterGetCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new PNCounterGetMessageTask(cm, node, con));
        factories.put(PNCounterAddCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new PNCounterAddMessageTask(cm, node, con));
        factories.put(PNCounterGetConfiguredReplicaCountCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new PNCounterGetConfiguredReplicaCountMessageTask(cm, node, con));
    }

    private void initializeManagementCenterTaskFactories() {
        factories.put(MCReadMetricsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReadMetricsMessageTask(cm, node, con));
        factories.put(MCChangeClusterStateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ChangeClusterStateMessageTask(cm, node, con));
        factories.put(MCGetMapConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new GetMapConfigMessageTask(cm, node, con));
        factories.put(MCUpdateMapConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new UpdateMapConfigMessageTask(cm, node, con));
        factories.put(MCGetMemberConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new GetMemberConfigMessageTask(cm, node, con));
        factories.put(MCRunGcCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RunGcMessageTask(cm, node, con));
        factories.put(MCGetThreadDumpCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new GetThreadDumpMessageTask(cm, node, con));
        factories.put(MCShutdownMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ShutdownMemberMessageTask(cm, node, con));
        factories.put(MCPromoteLiteMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new PromoteLiteMemberMessageTask(cm, node, con));
        factories.put(MCGetSystemPropertiesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new GetSystemPropertiesMessageTask(cm, node, con));
        factories.put(MCGetTimedMemberStateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new GetTimedMemberStateMessageTask(cm, node, con));
        factories.put(MCMatchMCConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new MatchClientFilteringConfigMessageTask(cm, node, con));
        factories.put(MCApplyMCConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ApplyClientFilteringConfigMessageTask(cm, node, con));
        factories.put(MCGetClusterMetadataCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new GetClusterMetadataMessageTask(cm, node, con));
        factories.put(MCShutdownClusterCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ShutdownClusterMessageTask(cm, node, con));
        factories.put(MCChangeClusterVersionCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ChangeClusterVersionMessageTask(cm, node, con));
        factories.put(MCRunScriptCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RunScriptMessageTask(cm, node, con));
        factories.put(MCRunConsoleCommandCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new RunConsoleCommandMessageTask(cm, node, con));
        factories.put(com.hazelcast.client.impl.protocol.codec.MCChangeWanReplicationStateCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ChangeWanReplicationStateMessageTask(cm, node, con));
        factories.put(com.hazelcast.client.impl.protocol.codec.MCClearWanQueuesCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ClearWanQueuesMessageTask(cm, node, con));
        factories.put(com.hazelcast.client.impl.protocol.codec.MCAddWanBatchPublisherConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AddWanBatchPublisherConfigMessageTask(cm, node, con));
        factories.put(com.hazelcast.client.impl.protocol.codec.MCWanSyncMapCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new WanSyncMapMessageTask(cm, node, con));
        factories.put(com.hazelcast.client.impl.protocol.codec.MCCheckWanConsistencyCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new CheckWanConsistencyMessageTask(cm, node, con));
        factories.put(MCPollMCEventsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new PollMCEventsMessageTask(cm, node, con));
        factories.put(MCTriggerPartialStartCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new HotRestartTriggerPartialStartMessageTask(cm, node, con));
        factories.put(MCTriggerForceStartCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new HotRestartTriggerForceStartMessageTask(cm, node, con));
        factories.put(MCTriggerHotRestartBackupCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new HotRestartTriggerBackupMessageTask(cm, node, con));
        factories.put(MCInterruptHotRestartBackupCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new HotRestartInterruptBackupMessageTask(cm, node, con));
        factories.put(MCResetQueueAgeStatisticsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new QueueResetAgeStatisticsMessageTask(cm, node, con));
        factories.put(MCReloadConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReloadConfigMessageTask(cm, node, con));
        factories.put(MCUpdateConfigCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new UpdateConfigMessageTask(cm, node, con));
        factories.put(MCDemoteDataMemberCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DemoteDataMemberMessageTask(cm, node, con));
    }

    private void initializeSqlTaskFactories() {
        factories.put(SqlExecuteCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SqlExecuteMessageTask(cm, node, con));
        factories.put(SqlFetchCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SqlFetchMessageTask(cm, node, con));
        factories.put(SqlCloseCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SqlCloseMessageTask(cm, node, con));
        factories.put(SqlMappingDdlCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SqlMappingDdlTask(cm, node, con));
    }

    private void initializeSchemaFactories() {
        factories.put(ClientSendSchemaCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SendSchemaMessageTask(cm, node, con));
        factories.put(ClientFetchSchemaCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new FetchSchemaMessageTask(cm, node, con));
        factories.put(ClientSendAllSchemasCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new SendAllSchemasMessageTask(cm, node, con));
    }

    @SuppressFBWarnings({"MS_EXPOSE_REP", "EI_EXPOSE_REP"})
    @Override
    public Int2ObjectHashMap<MessageTaskFactory> getFactories() {
        return factories;
    }
}
